import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {LoginComponent} from './login/login.component';
import {AuthGuard} from './auth.guard';
import {LayoutComponent} from './layout/layout.component';
import {HomeComponent} from './home/home.component';
import {AdminListComponent} from './admin/admin-list.component';
import {EnterpriseListComponent} from './enterprise/enterprise-list.component';
import {DepartmentListComponent} from './department/department-list.component';
import {PositionListComponent} from './position/position-list.component';
import {EmployeeListComponent} from './employee/employee-list.component';
import {EducationListComponent} from './education/education-list.component';
import {WorkExperienceListComponent} from './work-experience/work-experience-list.component';
import {SkillCertificateListComponent} from './skill-certificate/skill-certificate-list.component';
import {TrainingRecordListComponent} from './training-record/training-record-list.component';
import {ContractListComponent} from './contract/contract-list.component';
import {AttendanceListComponent} from './attendance/attendance-list.component';
import {SalaryListComponent} from './salary/salary-list.component';
import {ChartListComponent} from './chart/chart-list.component';

export const routes: Routes = [
  { path: 'login', component: LoginComponent },
  {
    path: '',
    component: LayoutComponent,
    canActivate: [AuthGuard],
    children: [
      { path: '', redirectTo: '/Home', pathMatch: 'full' },
      { path: 'Home', component: HomeComponent },
      { path: 'AdminList', component: AdminListComponent },
      { path: 'EnterpriseList', component: EnterpriseListComponent },
      { path: 'DepartmentList', component: DepartmentListComponent },
      { path: 'PositionList', component: PositionListComponent },
      { path: 'EmployeeList', component: EmployeeListComponent },
      { path: 'EducationList', component: EducationListComponent },
      { path: 'WorkExperienceList', component: WorkExperienceListComponent },
      { path: 'SkillCertificateList', component: SkillCertificateListComponent },
      { path: 'TrainingRecordList', component: TrainingRecordListComponent },
      { path: 'ContractList', component: ContractListComponent },
      { path: 'AttendanceList', component: AttendanceListComponent },
      { path: 'SalaryList', component: SalaryListComponent },
      { path: 'ChartList', component: ChartListComponent }
    ]
  },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
